
package com.wyzz.hr.action;

import java.io.PrintStream;
import java.math.BigDecimal;
import java.util.*;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.util.ObjectUtils;

import com.wyzz.hr.base.BaseDownloadAction;
import com.wyzz.hr.bo.IAttendmonthlyBO;
import com.wyzz.hr.bo.IEmpBenefitBo;
import com.wyzz.hr.bo.IEmpBenefitPlanBo;
import com.wyzz.hr.bo.IEmpSalaryAcctitemsBo;
import com.wyzz.hr.bo.IEmployeeBo;
import com.wyzz.hr.bo.IEmpsalaryperiodBo;
import com.wyzz.hr.bo.IPerfplanBO;
import com.wyzz.hr.bo.ISalaryPaidBo;
import com.wyzz.hr.bo.ISalaryconfBo;
import com.wyzz.hr.pojo.Department;
import com.wyzz.hr.pojo.Employee;
import com.wyzz.hr.pojo.Empsalaryacctitems;
import com.wyzz.hr.pojo.Empsalaryconfig;
import com.wyzz.hr.pojo.Empsalarypay;
import com.wyzz.hr.pojo.Emptype;
import com.wyzz.hr.pojo.Location;
import com.wyzz.hr.pojo.Statusconf;
import com.wyzz.hr.spring.SpringBeanFactory;
import com.wyzz.hr.util.InterpreterExecuteContext;
import com.wyzz.hr.util.ObjectUtil;

public class CompAction extends BaseDownloadAction {

	public CompAction() {
		msgNoAuth = "{0}:\u60A8\u65E0\u6743\u6267\u884C\u6B64\u64CD\u4F5C\uFF0C\u8BF7\u91CD\u65B0\u767B\u9646\uFF01";
		msgNoParam = "{0}:\u8F93\u5165\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgFormatErr = "{0}:{1}\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF01";
		msgOperErr = "{0}:{1}\u64CD\u4F5C\u5931\u8D25\uFF01";
		msgOperSucc = "{0}:{1}\u64CD\u4F5C\u6210\u529F\uFF01";
		msgNoData = "{0}:\u6CA1\u6709{1}\u6570\u636E\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";//{0}:没有{1}数据，请刷新后重试！
		msgNullErr = "{0}\u4E0D\u80FD\u4E3A\u7A7A\uFF01";
		msgSystemEx = "\u7CFB\u7EDF\u5F02\u5E38\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01"; //系统异常，请刷新后重试！
		msgDataEx = "\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgParamEx = "\u53C2\u6570\u5F02\u5E38\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgNoConfig = "{0}:{1}\u85AA\u8D44\u914D\u7F6E\u6570\u636E\u9519\u8BEF\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgHasConfig = "{0}:{1}\u85AA\u8D44\u914D\u7F6E\u6570\u636E\u5DF2\u7ECF\u5B58\u5728\uFF0C\u521B\u5EFA\u5931\u8D25\uFF01";
		msgCreateConfSucc = "{0}:\u521B\u5EFA{1}\u7684\u85AA\u8D44\u914D\u7F6E\u6210\u529F\u3002";
		msgCreateConfFail = "{0}:\u521B\u5EFA{1}\u7684\u85AA\u8D44\u914D\u7F6E\u5931\u8D25\uFF01";
		msgUpdConfSucc = "{0}:\u5DF2\u8C03\u6574{1}\u7684\u85AA\u8D44\u914D\u7F6E\u3002";
		msgUpdConfFail = "{0}:\u8C03\u6574{1}\u7684\u85AA\u8D44\u914D\u7F6E\u5931\u8D25\uFF01";
		msgDelConfSucc = "{0}:\u5DF2\u5220\u9664{1}\u7684\u85AA\u8D44\u914D\u7F6E\u3002";
		msgDelConfFail = "{0}:{1}\u5220\u9664{2}\u7684\u85AA\u8D44\u914D\u7F6E\u5931\u8D25\uFF01";
		msgAdjConfSucc = "{0}:\u8C03\u6574{1}\u7684\u85AA\u8D44\u914D\u7F6E\u6210\u529F\u3002";
		msgNoEmp = "{0}:\u5458\u5DE5\u9519\u8BEF\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgNoPay = "{0}:\u85AA\u8D44\u53D1\u653E\u6570\u636E\u9519\u8BEF\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";//{0}:薪资发放数据错误，请刷新后重试！
		msgFormatPay = "{0}:\u85AA\u8D44\u53D1\u653E\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\uFF01";
		msgAdjPaySucc = "{0}:\u8C03\u6574{1}\u7684\u85AA\u8D44\u53D1\u653E\u6210\u529F\u3002";
		msgFormulaIllegal = "\u60A8\u8F93\u5165\u7684\u516C\u5F0F{0}\u4E0D\u5408\u6CD5\uFF1A{1}";
		msgFormulaLegal = "{0}:\u60A8\u8F93\u5165\u7684\u516C\u5F0F{1}\u5408\u6CD5\u3002";
		msgNoBenefit = "{0}:\u627E\u4E0D\u5230{1}\u7684\u793E\u4FDD\u8BB0\u5F55\uFF0C\u8BF7\u91CD\u8BD5\uFF01";
		msghasBenefit = "{0}:{1}\u7684\u793E\u4FDD\u8BB0\u5F55\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u8BD5\uFF01";
		msgNoBaseErr = "{0}:\u8BF7\u81F3\u5C11\u586B\u5199\u4E00\u9879\u57FA\u6570\uFF01";
		msgStartYMTooEarly = "\u65B0\u8BB0\u5F55\u7684\u8D77\u59CB\u5E74\u6708\u5FC5\u987B\u665A\u4E8E\u8001\u8BB0\u5F55\u7684\u8D77\u59CB\u5E74\u6708\uFF01";
		msgCreateBeneSucc = "{0}:\u521B\u5EFA{1}\u7684\u793E\u4FDD\u8BB0\u5F55\u6210\u529F\u3002";
		msgUpdBeneSucc = "{0}:\u4FEE\u6539{1}\u7684\u793E\u4FDD\u8BB0\u5F55\u6210\u529F\u3002";
		msgAdjBeneSucc = "{0}:\u8C03\u6574{1}\u7684\u793E\u4FDD\u57FA\u6570\u6210\u529F\u3002";
		msgDupBenefitCur = "{0}:\u4E0D\u80FD\u8865\u7F34{1}\u793E\u4FDD\uFF0C\u5F53\u6708\u5E94\u6B63\u5E38\u7F34\u7EB3\uFF01";
		msgDupBenefitPre = "{0}:\u5DF2\u8865\u8FC7{1}\u793E\u4FDD\uFF0C\u5F53\u6708\u4E0D\u80FD\u91CD\u590D\u8865\u7F34\uFF01";
		msgStatErrBeneC = "{0}:\u8BA1\u85AA\u5468\u671F{1}\u5DF2\u63D0\u4EA4\u6216\u5DF2\u5C01\u5E10\uFF0C\u4E0D\u80FD\u8865\u7F34\u793E\u4FDD\uFF01";
		msgStatErrBeneP = "{0}:\u8BA1\u85AA\u5468\u671F{1}\u5C1A\u672A\u5C01\u5E10\uFF0C\u4E0D\u80FD\u8865\u7F34\u793E\u4FDD\uFF01";
		msgAddBeneSucc = "{0}:\u8865\u7F34{1}\u7684\u793E\u4FDD\u6210\u529F\uFF0C\u5FC5\u987B\u91CD\u65B0\u521D\u59CB\u5316{2}\u85AA\u8D44\uFF0C\u6539\u52A8\u624D\u4F1A\u751F\u6548\u3002";
		msgNoYm = "{0}:\u5E74\u6708\u6570\u636E\u9519\u8BEF\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgPeriodInitErr = "\u8BA1\u85AA\u5468\u671F\u5FC5\u987B\u4E3A\u521D\u59CB\u5316\u72B6\u6001\uFF0C\u624D\u53EF\u4EE5\u6267\u884C\u672C\u64CD\u4F5C\uFF01";
		msgPeriodSubmitErr = "\u8BA1\u85AA\u5468\u671F\u5FC5\u987B\u4E3A\u5DF2\u63D0\u4EA4\u72B6\u6001\uFF0C\u624D\u53EF\u4EE5\u6267\u884C\u672C\u64CD\u4F5C\uFF01";
		msgPeriodAppErr = "\u8BA1\u85AA\u5468\u671F\u5FC5\u987B\u4E3A\u5DF2\u5C01\u5E10\u72B6\u6001\uFF0C\u624D\u53EF\u4EE5\u6267\u884C\u672C\u64CD\u4F5C\uFF01";
		msgPeriodErr = "\u8BA1\u85AA\u5468\u671F\u72B6\u6001\u4E0D\u6B63\u786E\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\uFF01";
		msgAcctUpdConf = "{0}:\u5E10\u5957\u7248\u672C\u5DF2\u542F\u7528\uFF0C\u7CFB\u7EDF\u5C06\u81EA\u52A8\u66F4\u65B0\u5458\u5DE5\u85AA\u8D44\u914D\u7F6E\uFF0C\u60A8\u786E\u5B9A\u8981\u4FEE\u6539\u5417\uFF1F";//{0}:帐套版本已启用，系统将自动更新员工薪资配置，您确定要修改吗？
		msgAcctUpdConfPay = "{0}:\u5E10\u5957\u7248\u672C\u5DF2\u542F\u7528\uFF0C\u7CFB\u7EDF\u5C06\u81EA\u52A8\u66F4\u65B0\u5458\u5DE5\u85AA\u8D44\u914D\u7F6E\uFF0C\u5E76\u8C03\u6574\u85AA\u8D44\u53D1\u653E\u5386\u53F2\uFF0C\u60A8\u786E\u5B9A\u8981\u4FEE\u6539\u5417\uFF1F";//{0}:帐套版本已启用，系统将自动更新员工薪资配置，并调整薪资发放历史，您确定要修改吗？
		msgAcctUpdErr = "{0}:\u5E10\u5957\u7248\u672C\u6709\u91CD\u5927\u6539\u53D8\uFF0C\u85AA\u8D44\u53D1\u653E\u5386\u53F2\u65E0\u6CD5\u4FEE\u6B63\uFF0C\u8BF7\u70B9\u51FB\u201C\u53E6\u5B58\u201D\u6309\u94AE\uFF0C\u4FDD\u5B58\u4E3A\u65B0\u7248\u672C\uFF01";//{0}:帐套版本有重大改变，薪资发放历史无法修正，请点击“另存”按钮，保存为新版本！
	}

	public Empsalaryconfig loadConfig(String empId, String configId) {
		Empsalaryconfig config;
		if (empId != null) {
			IEmployeeBo empBo = (IEmployeeBo) SpringBeanFactory
					.getBean("empBo");
			String fetch[] = {
					Employee.PROP_EMP_BENEFIT_TYPE,
					Employee.PROP_EMP_BENEFIT,
					Employee.PROP_EMP_DEPT_NO,
					Employee.PROP_CONFIG,
					(new StringBuilder()).append(Employee.PROP_CONFIG).append(
							".").append(Empsalaryconfig.PROP_ESC_JOBGRADE)
							.toString(),
					(new StringBuilder()).append(Employee.PROP_CONFIG).append(
							".").append(Empsalaryconfig.PROP_ESC_ESAV_ID)
							.toString() };
			Employee emp = empBo.loadEmp(empId, fetch);
			if (emp.getConfig() == null) {
				config = new Empsalaryconfig();
				config.setEmployee(emp);
			} else {
				config = emp.getConfig();
			}
		} else {
			ISalaryconfBo configBo = (ISalaryconfBo) SpringBeanFactory
					.getBean("salaryconfBo");
			config = configBo.loadSalaryconf(configId, new String[] {
					Empsalaryconfig.PROP_ESC_JOBGRADE,
					Empsalaryconfig.PROP_ESC_ESAV_ID,
					Empsalaryconfig.PROP_EMPLOYEE,
					(new StringBuilder()).append(Empsalaryconfig.PROP_EMPLOYEE)
							.append(".").append(Employee.PROP_EMP_BENEFIT_TYPE)
							.toString(),
					(new StringBuilder()).append(Empsalaryconfig.PROP_EMPLOYEE)
							.append(".").append(Employee.PROP_EMP_BENEFIT)
							.toString(),
					(new StringBuilder()).append(Empsalaryconfig.PROP_EMPLOYEE)
							.append(".").append(Employee.PROP_EMP_DEPT_NO)
							.toString() });
			if (config == null)
				return null;
		}
		config.decryEmpSalaryConf(config);
		return config;
	}

	protected Empsalarypay loadPay(String payId, String empId, String yearmonth) {
		ISalaryPaidBo salaryPaidBo = (ISalaryPaidBo) getBean("salaryPaidBo");
		Empsalarypay pay = new Empsalarypay();
		if (!StringUtils.isEmpty(payId)) {
			pay = salaryPaidBo.loadSalaryPay(payId, new String[] {
					Empsalarypay.PROP_ESP_JOBGRADE,
					Empsalarypay.PROP_ESP_ESAV_ID,
					Empsalarypay.PROP_ESP_EMPCONFIG,
					Empsalarypay.PROP_ESP_EMPNO,
					(new StringBuilder()).append(Empsalarypay.PROP_ESP_EMPNO)
							.append(".").append(Employee.PROP_EMP_BENEFIT_TYPE)
							.toString() });
			if (pay == null)
				return null;
			pay.decryEMPPaid(pay);
			Empsalaryconfig config = pay.getEspEmpconfig();
			if (config != null)
				config.decryEmpSalaryConf(config);
		} else {
			IEmployeeBo empBo = (IEmployeeBo) SpringBeanFactory
					.getBean("empBo");
			String fetch[] = {
					Employee.PROP_EMP_BENEFIT_TYPE,
					Employee.PROP_CONFIG,
					(new StringBuilder()).append(Employee.PROP_CONFIG).append(
							".").append(Empsalaryconfig.PROP_ESC_JOBGRADE)
							.toString(),
					(new StringBuilder()).append(Employee.PROP_CONFIG).append(
							".").append(Empsalaryconfig.PROP_ESC_ESAV_ID)
							.toString() };
			Employee emp = empBo.loadEmp(empId, fetch);
			Empsalaryconfig config = emp.getConfig();
			if (config == null)
				return null;
			config.decryEmpSalaryConf(config);
			pay = copyConfigToPay(config);
			pay.setEspYearmonth(yearmonth);
		}
		return pay;
	}

	public static DetachedCriteria updatePayBatch_DC() {
		DetachedCriteria dc = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Empsalarypay.class);
		dc.createAlias(Empsalarypay.PROP_ESP_EMPNO, "emp", 1);
		dc.createAlias(Empsalarypay.PROP_ESP_JOBGRADE, "espJobgrade", 1);
		dc
				.createAlias((new StringBuilder()).append("emp.").append(
						Employee.PROP_EMP_BENEFIT_TYPE).toString(),
						"empBenefitType", 1);
		dc.createAlias((new StringBuilder()).append("emp.").append(
				Employee.PROP_EMP_DEPT_NO).toString(), "empDeptNo", 1);
		dc.createAlias(Empsalarypay.PROP_ESP_EMPCONFIG, "config", 1);
		dc
				.createAlias((new StringBuilder()).append("config.").append(
						Empsalaryconfig.PROP_ESC_JOBGRADE).toString(),
						"escJobgrade", 1);
		dc.createAlias((new StringBuilder()).append("config.").append(
				Empsalaryconfig.PROP_ESC_ESAV_ID).toString(), "escEsavId", 1);
		return dc;
	}

	public static DetachedCriteria updateConfigBatch_DC() {
		DetachedCriteria dc = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Employee.class);
		dc.createAlias(Employee.PROP_EMP_BENEFIT_TYPE, "empBenefitType", 1);
		dc.createAlias(Employee.PROP_EMP_BENEFIT, "benefit", 1);
		dc.createAlias(Employee.PROP_EMP_DEPT_NO, "empDeptNo", 1);
		dc.createAlias(Employee.PROP_CONFIG, "config", 0);
		dc
				.createAlias((new StringBuilder()).append("config.").append(
						Empsalaryconfig.PROP_ESC_JOBGRADE).toString(),
						"escJobgrade", 1);
		dc.createAlias((new StringBuilder()).append("config.").append(
				Empsalaryconfig.PROP_ESC_ESAV_ID).toString(), "escEsavId", 1);
		return dc;
	}

	protected boolean setPayAdd(String yearmonth, Empsalarypay payArray[]) {
		if (StringUtils.isEmpty(yearmonth) || ObjectUtils.isEmpty(payArray))
			return false;
		IEmpSalaryAcctitemsBo esaiBo = (IEmpSalaryAcctitemsBo) SpringBeanFactory
				.getBean("empsalaryacctitemsBo");
		if (!esaiBo.setAcctItemsPay(payArray)) {
			return false;
		} else {
			IEmpBenefitBo empbenefitBo = (IEmpBenefitBo) SpringBeanFactory
					.getBean("empbenefitBo");
			empbenefitBo.setEmpBenefitPay(yearmonth, payArray);
			IAttendmonthlyBO attendmonBo = (IAttendmonthlyBO) SpringBeanFactory
					.getBean("attendmonthlyBo");
			attendmonBo.setAttmByPay(yearmonth, payArray);
			IPerfplanBO perfplanBO = (IPerfplanBO) SpringBeanFactory
					.getBean("perfplanBO");
			perfplanBO.setPerfplanByPay(yearmonth, payArray);
			IEmpBenefitPlanBo ebpBo = (IEmpBenefitPlanBo) SpringBeanFactory
					.getBean("empbenefitplanBo");
			ebpBo.setAddEbpSum(yearmonth, payArray);
			return true;
		}
	}

	protected boolean setPayValues(String salaryValue, Empsalarypay pay) {
		if (StringUtils.isEmpty(salaryValue) || pay == null)
			return false;
		Empsalaryconfig config = pay.getEspEmpconfig();
		List acctItems = pay.getAcctItems();
		pay.setEspChanged(Integer.valueOf(0));
		try {
			String salary[] = salaryValue.split(",");
			List salaryValueItems = new ArrayList();
			for (int i = 0; i < salary.length; i++)
				salaryValueItems.add(new BigDecimal(salary[i]));

			for (int i = 0; i < acctItems.size(); i++) {
				Empsalaryacctitems item = (Empsalaryacctitems) acctItems.get(i);
				if (item.getEsaiDataIsCalc().intValue() != 2) {
					BigDecimal newValue = (BigDecimal) salaryValueItems.get(i);
					if (changePayItem(pay, config, newValue, i + 1))
						pay.setEspChanged(Integer.valueOf(1));
				}
			}

		} catch (Exception e) {
			System.out.println(e);
			return false;
		}
		return true;
	}

	protected boolean interpretPay(String yearmonth, boolean add0And1,
			Empsalarypay payArray[]) {
		if (StringUtils.isEmpty(yearmonth) || ObjectUtils.isEmpty(payArray)) {
			return false;
		} else {
			InterpreterExecuteContext context = new InterpreterExecuteContext(
					yearmonth);
			context.execute(getCurrentEmpNo(), add0And1, payArray);
			return true;
		}
	}

	protected List getPayItemsPage(Empsalarypay pay) {
		if (pay == null)
			return null;
		List acctItems = pay.getAcctItems();
		Empsalaryconfig config = pay.getEspEmpconfig();
		try {
			for (int i = 0; i < acctItems.size(); i++) {
				Empsalaryacctitems item = (Empsalaryacctitems) acctItems.get(i);
				Object escValue = PropertyUtils.getProperty(config,
						(new StringBuilder()).append("escColumn").append(i + 1)
								.toString());
				Object espValue = PropertyUtils.getProperty(pay,
						(new StringBuilder()).append("espColumn").append(i + 1)
								.toString());
				if (escValue != null && espValue != null) {
					item.setItemValue((BigDecimal) escValue);
					item.setItemConfigValue((BigDecimal) espValue);
					if (!escValue.equals(espValue))
						item.setItemChanged(Integer.valueOf(1));
				} else if (escValue != null) {
					item.setItemValue((BigDecimal) escValue);
					item.setItemConfigValue(new BigDecimal(0.0D));
					item.setItemChanged(Integer.valueOf(1));
				} else if (espValue != null) {
					item.setItemValue(new BigDecimal(0.0D));
					item.setItemConfigValue((BigDecimal) espValue);
					item.setItemChanged(Integer.valueOf(1));
				} else {
					item.setItemValue(new BigDecimal(0.0D));
					item.setItemConfigValue(new BigDecimal(0.0D));
				}
			}

		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		return acctItems;
	}

	public Empsalarypay copyConfigToPay(Empsalaryconfig config) {
		Empsalarypay pay = new Empsalarypay();
		if (config == null)
			return null;
		try {
			for (int i = 1; i <= 48; i++) {
				Object value = PropertyUtils.getProperty(config,
						(new StringBuilder()).append("escColumn").append(i)
								.toString());
				PropertyUtils.setProperty(pay, (new StringBuilder()).append(
						"espColumn").append(i).toString(), value);
			}

		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		pay.setEspEmpconfig(config);
		pay.setEspEmpno(config.getEmployee());
		pay.setEspEsavId(config.getEscEsavId());
		pay.setEspJobgrade(config.getEscJobgrade());
		pay.setEspDept(config.getEmployee().getEmpDeptNo());
		pay.setEspEmptype(config.getEmployee().getEmpType());
		pay.setEspLocation(config.getEmployee().getEmpLocationNo());
		pay.setEspPbNo(config.getEmployee().getEmpPbNo());
		pay.setEspBankAccountNo(config.getEscBankAccountNo());
		pay.setEspBankName(config.getEscBankName());
		pay.setEspCostCenter(config.getEscCostCenter());
		return pay;
	}

	public boolean checkSalaryPeriod(String yearmonth, Integer status[]) {
		IEmpsalaryperiodBo periodBo = (IEmpsalaryperiodBo) SpringBeanFactory
				.getBean("empsalaryperiodBO");
		Integer currStatus = periodBo.getEspdStatusNew(yearmonth);
		return ObjectUtil.contains(status, currStatus);
	}

	public String getEmpType(String id) {
		if (StringUtils.isEmpty(id))
			return "";
		for (Iterator i$ = empTypeList.iterator(); i$.hasNext();) {
			Emptype empType = (Emptype) i$.next();
			if (empType.getId().equals(id))
				return empType.getEmptypeName();
		}

		return "";
	}

	public String getLocation(String id) {
		if (StringUtils.isEmpty(id))
			return "";
		for (Iterator i$ = locationList.iterator(); i$.hasNext();) {
			Location location = (Location) i$.next();
			if (location.getId().equals(id))
				return location.getLocationName();
		}

		return "";
	}

	public String getDepName(String id) {
		if (StringUtils.isEmpty(id))
			return "";
		for (Iterator i$ = departs.iterator(); i$.hasNext();) {
			Department dep = (Department) i$.next();
			if (dep.getId().equals(id))
				return dep.getDepartmentName();
		}

		return "";
	}

	public String getEmpStatusName(int id) {
		for (Iterator i$ = empStatus.iterator(); i$.hasNext();) {
			Statusconf statusconf = (Statusconf) i$.next();
			if (statusconf.getId().getStatusconfNo().intValue() == id)
				return statusconf.getStatusconfDesc();
		}

		return "\u65E0\u72B6\u6001";
	}

	public static boolean changePayItem(Empsalarypay pay,
			Empsalaryconfig config, BigDecimal newPayValue, int index)
			throws Exception {
		Object escValue = PropertyUtils.getProperty(config,
				(new StringBuilder()).append("escColumn").append(index)
						.toString());
		PropertyUtils.setProperty(pay, (new StringBuilder())
				.append("espColumn").append(index).toString(), newPayValue
				.setScale(2));
		if (escValue == null
				&& newPayValue.compareTo(new BigDecimal(0.0D)) == 0)
			return false;
		return newPayValue.compareTo((BigDecimal) escValue) != 0;
	}

	private static final long serialVersionUID = 1L;
	public String msgNoAuth;
	public String msgNoParam;
	public String msgFormatErr;
	public String msgOperErr;
	public String msgOperSucc;
	public String msgNoData;
	public String msgNullErr;
	public String msgSystemEx;
	public String msgDataEx;
	public String msgParamEx;
	public String msgNoConfig;
	public String msgHasConfig;
	public String msgCreateConfSucc;
	public String msgCreateConfFail;
	public String msgUpdConfSucc;
	public String msgUpdConfFail;
	public String msgDelConfSucc;
	public String msgDelConfFail;
	public String msgAdjConfSucc;
	public String msgNoEmp;
	public String msgNoPay;
	public String msgFormatPay;
	public String msgAdjPaySucc;
	public String msgFormulaIllegal;
	public String msgFormulaLegal;
	public String msgNoBenefit;
	public String msghasBenefit;
	public String msgNoBaseErr;
	public String msgStartYMTooEarly;
	public String msgCreateBeneSucc;
	public String msgUpdBeneSucc;
	public String msgAdjBeneSucc;
	public String msgDupBenefitCur;
	public String msgDupBenefitPre;
	public String msgStatErrBeneC;
	public String msgStatErrBeneP;
	public String msgAddBeneSucc;
	public String msgNoYm;
	public String msgPeriodInitErr;
	public String msgPeriodSubmitErr;
	public String msgPeriodAppErr;
	public String msgPeriodErr;
	public String msgAcctUpdConf;
	public String msgAcctUpdConfPay;
	public String msgAcctUpdErr;
	protected List departs;
	protected List empTypeList;
	protected List empStatus;
	protected List locationList;
}
